<%
title = 'install options'
description = 'Installation options for mountebank, many of which require no platform dependencies'
%>

<% include ../_header %>

<h1>Installation Options</h1>

<p>mountebank knows first-hand how frustrating it is to be working in .NET and have to
fiddle with a JDK just to get a testing library working, and the hassle of setting up
ruby in your build pipeline to compile CSS even though you're on a Java project.  mountebank
wants you to be happy, and therefore he supports the following hassle-free installation options,
which he assures you just work.</p>

<%
var versionWithoutPatch = version.replace(/\.\d+(-beta\.\d+)?$/,'');
var versionPath = encodeURIComponent(version);
%>

<table>
  <tr>
    <th>Option</th>
    <th>node.js required?</th>
    <th>sudo required?</th>
    <th>links</th>
    <th>Description</th>
  </tr>
  <tr>
    <td>Docker image</td>
    <td>No</td>
    <td>No</td>
    <td><a href='https://hub.docker.com/repository/registry-1.docker.io/bbyars/mountebank'>Docker hub</a></td>
    <td>Can run with a command like <code>docker run --rm -p 2525:2525 -p 8080:8080 mountebank:<%= version %>%> mb start --configfile imposters.ejs</code></td>
  </tr>
  <tr>
    <td>Self-contained archives</td>
    <td>No</td>
    <td>No</td>
    <td style="min-width: 5em;">
      <ul>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank-v<%= versionPath %>-darwin-x64.tar.gz">osx</a></li>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank-v<%= versionPath %>-linux-x64.tar.gz">linux x64</a></li>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank-v<%= versionPath %>-win-x86.zip">win x86<sup>*</sup></a></li>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank-v<%= versionPath %>-win-x64.zip">win x64<sup>*</sup></a></li>
      </ul>
    </td>
    <td>Simply unpack and run <code>mb</code> from inside.  See below for Windows constraints.</td>
  </tr>
  <tr>
    <td>OS-specific packages</td>
    <td>No</td>
    <td>Yes</td>
    <td>
      <ul>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank-v<%= versionPath %>.pkg">pkg</a></li>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank-<%= versionPath.replace('-beta', '_beta') %>-1.x86_64.rpm">rpm</a></li>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank_<%= versionPath %>_amd64.deb">deb</a></li>
      </ul>
    </td>
    <td>Puts <code>mb</code> at <code>/usr/local/bin</code>, which is generally in the <code>PATH</code>.</td>
  </tr>
  <tr>
    <td>source tarball</td>
    <td>Yes</td>
    <td>No</td>
    <td>
      <ul>
        <li><a href="https://s3.amazonaws.com/mountebank/v<%= versionWithoutPatch %>/mountebank-v<%= versionPath %>-npm.tar.gz">mb</a></li>
      </ul>
    </td>
    <td>source tarball if you roll that way.</td>
  </tr>
</table>

<h2 id='system-daemon'>Running as a system daemon</h2>
You can also configure mountebank to run as a unix system daemon. A sample ansible playbook and systemd configuration file is
available <a href="https://github.com/bbyars/mountebank/tree/master/scripts/install">here</a> (Tested on RHEL7 and Centos7).

<h2 id='windows-path-limitations'>Windows path limitations</h2>

<p><sup>*</sup>mountebank wishes very much for your Windows experience to be hassle-free, but he is simply not qualified to address
  a particular constraint of Windows Explorer.  For legacy reasons, some Windows applications, including most notably Windows Explorer, have a maximum number of characters
  allowed in a path of 260 characters.  As mountebank writes these words, the longest path he includes in the zip files is
  around 175 characters.  The zip file name, which is likely to represent itself as <i>two</i> nested directories if you use
  the defaults to unzip it, will be around 25 characters.  That gives you very little wiggle room.  If you unzip the file in your users
  directory, you may very likely get an error because of this constraint.</p>

<p>The following solutions will all work:</p>

<ul class='bullet-list'>
  <li>Unzip to the root of your C: drive (or a similar small path)</li>
  <li>Use <a href='http://www.7-zip.org/'>7zip</a> to unzip the file instead of Windows Explorer</li>
  <li>Use <code>npm</code> to install mountebank instead of the zip file</li>
</ul>

<% include ../_footer %>
